﻿using System;
using System.Collections.Generic;
using WpfApp1.Enum;

namespace WpfApp1.Model
{
    class TrainModel : NoticeObject
    {
        private long id;
        private long parentId;
        // 产品知识、病理培训
        private TrainSubject subject;
        // 品种 ACDEIJK JN/ZD ZDH/SG GA
        private string kind;
        private string area;
        private string chainShop;
        private DateTime startTime;
        private DateTime endTime;
        // 选择 微信、视频、直播、店员培训、消费者教育、员工内训
        private TrainType type;
        private string require;
        private string pptPath;
        private long len;
        private string summary;
        private string feedBack;
        // 效果
        private string effect;
        private List<ProductKind> kinds = new List<ProductKind>() { };


        public long Id { get { return id; } set { id = value; RaisePropertyChanged("Id"); } }
        public long ParentId { get { return parentId; } set { parentId = value; RaisePropertyChanged("ParentId"); } }
        public TrainSubject Subject { get { return subject; } set { subject = value; RaisePropertyChanged("Subject"); } }
        public string Kind { get { return kind; } set { kind = value; RaisePropertyChanged("Kind"); } }
        public string Area { get { return area; } set { area = value; RaisePropertyChanged("Area"); } }
        public string ChainShop { get { return chainShop; } set { chainShop = value; RaisePropertyChanged("ChainShop"); } }
        public DateTime StartTime { get { return startTime; } set { startTime = value; RaisePropertyChanged("StartTime"); } }
        public DateTime EndTime { get { return endTime; } set { endTime = value; RaisePropertyChanged("EndTime"); } }
        public TrainType Type { get { return type; } set { type = value; RaisePropertyChanged("Type"); } }
        public string Require { get { return require; } set { require = value; RaisePropertyChanged("Require"); } }
        public string PptName { get { return pptPath; } set { pptPath = value; RaisePropertyChanged("PptName"); } }
        public long Length { get { return len; } set { len = value; RaisePropertyChanged("Length"); } }
        public string Summary { get { return summary; } set { summary = value; RaisePropertyChanged("Summary"); } }
        public string FeedBack { get { return feedBack; } set { feedBack = value; RaisePropertyChanged("FeedBack"); } }
        public string Effect { get { return effect; } set { effect = value; RaisePropertyChanged("Effect"); } }
        public List<ProductKind> Kinds
        {
            get { return kinds; }
            set
            {
                kinds = value;
                string newKind = "";
                foreach (ProductKind productKind in value)
                {
                    newKind += "," + productKind.ToString();
                }
                kind = newKind.TrimStart(",".ToCharArray());
                RaisePropertyChanged("Kinds");
                RaisePropertyChanged("Kind");
            }
        }
    }
}
